#include "widgetmanage.h"

QMutex WidgetManage::mutex;
WidgetManage* WidgetManage::instance=NULL;

WidgetManage::WidgetManage()
{

}

void WidgetManage::AddWidget(QString name,QWidget* widget)
{
    if(widget==NULL) return;
    widgets.insert(name,widget);
}

QWidget *WidgetManage::GetWidget(QString name)
{
    if(widgets.contains(name))
    {
        return widgets[name];
    }
    else
    {
        return NULL;
    }
}

void  WidgetManage::SetCurrentWidget(QWidget *pWidget)
{
    pCurrentWidget=pWidget;
}

QWidget *WidgetManage::GetCurrentWidget()
{
    return pCurrentWidget;
}
